# import sys
# file=sys.stdout
# file.write('hello')
#
# print('world')


file=open('text.txt','rb')
print(file.read(1))
print(file.read(1))
print(file.tell())
print(file.seek(2,1))


#不需要写close
# with open('text.txt','r',encoding='utf-8') as file2:
#       # print(file2.readline())
#       # print(file2.readline())
#       list=file2.readlines()
#       print(list)
#
#
# str="hello world  "
# with open('text.txt','w',encoding='utf-8') as file3:
#       file3.write(str)
#
# list3=['hello11','world22']
# with open('text.txt','a',encoding='utf-8') as file4:
#       file4.writelines(list3)

